package com.zqh.myfmmall.fallback;

import com.zqh.myfmmall.clients.OrderUDClient;
import com.zqh.myfmmall.result.Result;
import com.zqh.myfmmall.rowbeans.entity.Orders;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

/**
 * @Description :
 * @Author :kono淇杭哒、
 * @Create 2022-03-16 20:20
 */
@Slf4j
public class OrderUdClientFallback implements FallbackFactory<OrderUDClient>{
    @Override
    public OrderUDClient create(Throwable cause) {
      log.warn("调用订单修改服务异常："+cause);
      return new OrderUDClient(){
          @Override
          public Result update(Orders order) {
              return Result.internalServerError();
          }

          @Override
          public Result delete(String id) {
              return Result.internalServerError();
          }
      };
    }
}
